<template>
  <div class="page_title">
    {{ title }}
    <span class="dir">文件地址：{{ fileUrl }}</span>
  </div>
</template>

<script>
export default {
  name: "HelloWorld",
  computed: {
    title() {
      return (
        this.$route?.meta?.title ||
        "请在router/index.js 中meta.title 中配置标题"
      );
    },
    fileUrl() {
      if (this.$route?.name) {
        const split = this.$route.name.split("I");
        return `src/views/${split[0]}/i${split[1]}.vue`;
      } else {
        return "请在router/index.js 中 name 中配置路径";
      }
    },
  },
};
</script>
<style scoped>
.page_title {
  width: 90%;
  margin: 0 auto;
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 20px;
  /* border-bottom: 1px solid #004896; */
}
.dir {
  float: right;
}
</style>
